#!/bin/bash
# Author:左岩
# The require condition is Yum is install and Linux is Centos7
# Function ： Change the Centos repo to aliyun to improve the speed
# Explanation: This shell is only able to suppot centos7
# in the next version I will add the Centos5 and Centos6 Support

# 1.First Backup the source repo in order to recover the last version
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

# 2.Download the new Centos-Base.repo to the /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 3.Run the yum makecache to build cache
yum clean all
yum makecache

